<?php

require_once '\..\calc.php';

class calcTest extends PHPUnit_Framework_TestCase {

    private $calc = NULL;

    public function setUp() {
        $this->calc = new Calc;
    }

    public function tearDown() {
        
    }

    public function testMultiply() {
        $this->assertEquals($this->calc->multiply(1, 1), 1);
    }

    public function testDiff() {
        $this->assertEquals($this->calc->diff(5, 2), 3);
    }

    public function testDivide() {
        $this->assertEquals($this->calc->div(2, 2, 0), 1);
    }

    /**
     * 
     * @dataProvider _providerAdd
     */
    public function testAdd($a, $b, $c) {
        $this->assertEquals($this->calc->sum($a, $b), $c);
    }

    public function _providerAdd() {
        return array(
            array(0, 0, 0),
            array(1, 0, 1),
            array(0, 1, 1),
            array(1, 1, 2),
        );
    }

}

